import * as js from "@eslint/js";
import * as globals from "globals";
import tseslint from "typescript-eslint";
import { defineConfig } from "eslint/config";

export default defineConfig([
    {
        files: ["**/*.{mts}"],
        plugins: { js },
        extends: ["js/recommended"],
        languageOptions: { globals: globals.browser },
    },
    tseslint.configs.recommended,
    {
        rules: {
            "no-console": 1, // 禁用 console
            "init-declarations": "off",
            "@typescript-eslint/ban-types": 0,
            "@typescript-eslint/no-explicit-any": 0,
            "@typescript-eslint/no-namespace": 0,
            "@typescript-eslint/no-unused-vars": 1,
            "@typescript-eslint/class-methods-use-this": 0,
            "@typescript-eslint/consistent-type-definitions": 2,
            "@typescript-eslint/init-declarations": "error",
            "prefer-const": 0,
            "prettier/prettier": 0,
        },
    },
]);
